<template>
	<div class="cartbtn">
		<a class="cart2" @click="cart()">
			<img src="../../../../assets/img/pc/我的购物车-hover.png" />
			<h4>我的购物车</h4>
		</a>
	</div>
</template>

<script>
	export default {
		name: 'Cartbtn',
		data() {
			return {

			}
		},
		methods: {
			cart() {
				let token = localStorage.getItem('token');
				if (token == null) {
					alert('未登录！无法查看您的购物车！请先登录.....');
					this.$router.push('/pc/login');
				} else {
					this.$router.push('/pc/cart');
				}
			}
		}
	}
</script>

<style scoped>
	.cartbtn {
		width: 100%;
	}

	.cart2 h4 {
		color: red;
	}

	.cart2 img {
		margin-left: 30px;
		height: 20px;
	}
</style>